package com.punai.externalccb.constants;

/**
 * ccb 常量
 */
public class CCBConstants {

    public enum CCB_TYPE{
        BQCB("01","标前成本","preData"),
        MBZRCB("02","项目责任成本","targetPlan"),
        FGSMBCB("14","分公司目标成本",""),
        YDCBFX("03","月度成本分析",""),
        JGCBFX("04","竣工成本分析","completionCost"),
        JGLRHS("05","竣工利润核算",""),
        CBZB("06","成本指标",""),

        KGYSSJ("07","开工预算",""),
        JGJSSJ("08","竣工结算",""),
        CZTJ("12","产值统计",""),
        SRZB("13","收入指标",""),
        ;

        private String code;
        private String desc;
        private String alias;

        CCB_TYPE(String code,String desc,String alias) {
            this.code = code;
            this.desc = desc;
            this.alias = alias;
        }

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public String getAlias() {
            return alias;
        }

        public void setAlias(String alias) {
            this.alias = alias;
        }

        public static String getDescByCode(String code) {
            for (CCB_TYPE value : values()) {
                boolean equals = value.getCode().equals(code);
                if (equals) {
                    return value.getDesc();
                }
            }
            return "";
        }


        public static String getCodeByAlias(String alias) {
            for (CCB_TYPE value : values()) {
                boolean equals = value.getAlias().equals(alias);
                if (equals) {
                    return value.getCode();
                }
            }
            return "";
        }

    }


}
